import { query } from '~/apis/types/query'
import System from '~/utils/System'

export default class ApiAuthUser {
    static list(query?: query) {
        return System.http.get(
            {
                url: 'auth/user/list',
                method: 'post'
            },
            { ...query }
        )
    }

    static save(param: any) {
        return System.http.get(
            {
                url: 'auth/user/save',
                method: 'post'
            },
            param
        )
    }

    static remove(id: string) {
        return System.http.get(
            {
                url: 'auth/user/remove',
                method: 'post'
            },
            { id }
        )
    }

    static login(param: { account: string; password: string } | { phone: string; code: string }) {
        return System.http.get(
            {
                url: 'auth/user/login',
                method: 'post'
            },
            param
        )
    }

    static resetPW(param: { old: string; newstr: string }) {
        return System.http.get(
            {
                url: 'auth/user/resetPW',
                method: 'post'
            },
            param
        )
    }
}
